from tkinter import *
from tkinter.messagebox import *


class InputFrame(Frame):  # 继承Frame类
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.root = master  # 定义内部变量root
        self.time = StringVar()
        self.locate = StringVar()
        self.createPage()

    def createPage(self):
        Label(self, text='约会时间：').grid(row=2, stick=W, pady=12)
        Entry(self, textvariable=self.time).grid(row=2, column=1, stick=E)
        Label(self, text='约会地点：').grid(row=3, stick=W, pady=12)
        Entry(self, textvariable=self.locate).grid(row=3, column=1, stick=E)
        Button(self, text='录入', command=self.input1).grid(row=5, column=1, stick=E, pady=10)

    def input1(self):
        showinfo(title='提示', message='地点插入成功！')


class QueryFrame(Frame):  # 继承Frame类
    def __init__(self, master=NONE):
        Frame.__init__(self, master)
        self.root = master  # 定义内部变量root
        self.user_num = StringVar()
        self.locate_name = StringVar()
        self.createPage()

    def createPage(self):
        Label(self, text='工作人员账号：').grid(row=1, stick=W, pady=10)
        Entry(self, textvariable=self.user_num).grid(row=1, column=1, stick=E)
        Label(self, text='地点名称：').grid(row=2, stick=W, pady=10)
        Entry(self, textvariable=self.locate_name).grid(row=2, column=1, stick=E)
        Button(self, text='插入', command=self.input2).grid(row=5, column=1, stick=E, pady=10)

    def input2(self):
        showinfo(title='提示', message='数据录入成功！')


class AlterFrame(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.root = master  # 定义内部变量root
        self.user_num = StringVar()
        self.old_own = StringVar()
        self.new_own = StringVar()
        self.createPage()

    def createPage(self):
        Label(self, text='用户手机号：').grid(row=1, stick=W, pady=10)
        Entry(self, textvariable=self.user_num).grid(row=1, column=1, stick=E)
        Label(self, text='用户原状态：').grid(row=2, stick=W, pady=10)
        Entry(self, textvariable=self.old_own).grid(row=2, column=1, stick=E)
        Label(self, text='用户现状态：').grid(row=3, stick=W, pady=10)
        Entry(self, textvariable=self.new_own).grid(row=3, column=1, stick=E)
        Button(self, text='修改', command=self.alter).grid(row=5, column=1, stick=E, pady=10)

    def alter(self):
        showinfo(title='提示', message='修改成功！')
